<?php
namespace app\member\controller;

use app\common\controller\MemberBase;
use app\common\model\Sms as cxModel;

class Sms extends MemberBase {

    //  会员中心首页
    public function index(){
        $cxmodel = new cxModel();
        $smslist = $cxmodel->where('uid',$this->cxbsuser['uid'])->order('addtime desc')->paginate('20');
        $pages = $smslist->render();
        if(!empty($smslist)){
            foreach ($smslist as $k => $v){
                if($v['fuid'] == '0'){
                    $v['funame'] = '系统消息';
                }else{
                    $v['funame'] = model('UserData')->where('uid',$v['fuid'])->value('uniname');
                }
                $smslist[$k] = $v;
            }
        }
        $webs = array(
            'title' => '我的站内信---'.$this->webdb['webname'],
            'keywords' => $this->webdb['webkeywords'],
            'description' => $this->webdb['description'],
        );
        $this->assign([
            'webs' => $webs,
            'list' => $smslist,
        ]);
        return view($this->temp.'user_sms.htm');
    }

}
